'''
Created on 2013-6-21

@author: enfuzion
'''


import random
import socket
import sys
import threading
import time

        
    
if (__name__ == '__main__'):
        print "z","b"
        print sys.argv
        address = ('127.0.0.1',8888)
        s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
        s.connect(address)
        sendStr = sys.argv[1]+'\r\n'
        try:
            s.send(sendStr)
            while True:
                data = s.recv(512)
                if(not data):
                    break
                print data ,
                sys.stdout.softspace=0

        except:
            print 'error'
        s.close()
